<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		
	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"> <a href="javascript:;" onclick="javascript:location.href='./material-list.html'"><span class="iconfont icon-fanhui"></span></a> </div>
				<div class="col-xs-8"><h2>材料需求详情</h2></div>
				<div class="col-xs-2 text-right" id="edit"><a href="material-edit.html">编辑</span></a></div>
			</div>
			<div class="row">
				<dl class="erp-list visa-details">
					<dd>
						<!-- 头部 -->
						<div class="erp-txt visa-txt" id="ttt">
						</div>
					</dd>
					<div id="sss">
						<dd >
						</dd>
					</div>
				</dl>
			</div>
		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/js/template-web.js" type="text/javascript" charset="utf-8"></script>
<script id="t" type="text/html">
	<input type="hidden" name="feed_code" value="{{feed_code}}">
	<p><span class="sp">申请单单号:</span><span class="divCon">{{feed_code}}</span></p>
	<p><span class="sp">项目名称:</span><span class="divCon">{{proName}}</span></p>
	<p><span class="sp">收货单位:</span><span class="divCon">{{compName1}}</span></p>
	<p><span class="sp">收货地址:</span><span class="divCon">{{f_adr}}</span></p>
	<p><span>供货时间:</span>{{supply_Time}}</p>
	<p><span class="sp">申请人:</span><span class="divCon">{{feed_sqr}}</span></p>

</script>
<script id="m_list" type="text/html">
	{{each data as value i}}
	<dd>
		<div class="erp-txt visa-txt">
			<p><span class="sp">材料名称:</span><span class="divCon">{{value.mat_Name}}</span></p>
			<p><span>规格:</span>{{value.mat_Spec}}</p>
			<p><span>审核状态:</span>{{value.validate==-1?"等待审核":value.validate==0?"审核通过":value.validate==1?"审核不通过":"已发货"}}</p>
			<p ><span>申请数量:</span>{{value.feed_Num}}</p>
			<p ><span>审核数量:</span>{{value.fv_Num}}</p>
			<p ><span>计量单位:</span>{{value.mat_bit}}</p>

			<p><span class="sp">备注:</span><span class="divCon">{{value.valOpition}}</span></p>
		</div>
	</dd>
	{{/each}}

</script>
<script>
    //获取列表页的内容
    var obj = sessionStorage.getItem("obj");
    //传入id来进行渲染
	console.log(obj)
    var html = template('t', JSON.parse(obj));
    document.getElementById('ttt').innerHTML =  html;
	//详情
    loadDetails();
    /**
     * 	加载详情
     */
    function loadDetails() {
        var feed_code = $("input[name='feed_code']").val();
        gundong(function(){
            ajaxs('api/material/loadMatFeedPic.do',
                'post',
                {'type':'b','feed_code':feed_code,'p':getP()},
                function (data) {
                    console.log(data);
                    //传入id来进行渲染
                    var html = template('m_list', data);
                    document.getElementById('sss').innerHTML =  html;
                });
        }());
    }
	var states=JSON.parse(obj);


    states=states.state;
    console.log(states)
	if ( states == "已审核"){
        $("#edit").remove();
	}



</script>






